Skip to main content

Layers

Manipulate the layers (OCGs) of your PDF documents.

OCGs ?

Optional Content Groups

Functions

getLayers ⇒ JSON

Get the PDF layers list.

Example

TFTPDFGadget.callCommand({ name: 'getLayers', callback: myfunc });

Available quality options:

  • low: 65% quality
  • medium: 85% quality
  • high: 125% quality

getActiveLayers ⇒ JSON

Get the list of layers present in current active pages.

Example

TFTPDFGadget.callCommand({ name: 'getActiveLayers', callback: myfunc });

setLayers

Toggle the visibility of layers.

ParamTypeDescription
layersobjectA JSON to define visiblity status of pdf's reference

Example

TFTPDFGadget.callCommand({
name: 'setLayers',
args: { layers: { off: [{ num: 6, gen: 0 }], baseState: 'ON' } },
callback: myfunc,
});

resetLayers

Reset the layers.

Example

TFTPDFGadget.callCommand({ name: 'resetLayers', callback: myfunc });